package com.bjpowernode.springboot.web;

import com.alibaba.dubbo.config.annotation.Reference;
import com.bjpowernode.springboot.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @DATE 2021--11--29 10:56
 */
@Controller
public class StudentController {
//dubbo；reference interface="" version="" check=false
    @Reference(interfaceClass = StudentService.class,version="1.0.0",check = false)
    private StudentService studentService;

//    @Autowired
//    private StudentService studentService;

    @RequestMapping(value = "/student/count")
    public @ResponseBody Object studentCount(){
        Integer AllStudentCount = studentService.queryAllStudentCount();
        return "学上总人数为：" + AllStudentCount;
    }
}
